// Have include guard.
#ifndef FPK_CASTFILTER_HPP
#define FPK_CASTFILTER_HPP

#include "Filter.hpp"

/**
 *  The CastFilter template class is a filter that uses C++'s built in conversion feature to filter an input into an object of the Output type.
 *  
 *  @tparam Input The type of the input object.
 *  @tparam Output The type of the output object.
 */
template<typename Input, typename Output>
class CastFilter :
	public Filter<Input, Output>
{
	public:
		/**
		 *  Apply the filter to an input.
		 *  
		 *  This will create an output object using the constructor syntax "Output(input)".
		 *  
		 *  @param input A reference to the input (which will not get modified).
		 *  @return The output of the filtered input.
		 */
		virtual Output Apply(const Input &input) const
		{
			return Output(input);
		}
};

#endif // #ifndef FPK_CASTFILTER_HPP
